package com.fulu.game.bi.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum DataFromEnum {
    TOTAL(1, "全部用户"),
    NEW(2, "新用户"),
    OLD(3, "老用户"),
    ;

    private Integer type;
    private String name;

    public static DataFromEnum getEnum(Integer type) {
        for (DataFromEnum e : DataFromEnum.values()) {
            if (Objects.equals(e.getType(), type)) {
                return e;
            }
        }
        return null;
    }
}
